Add server-side parameters to request object#174
Conversation
src/Server.php
Outdated
There was a problem hiding this comment.
Does it make sense to move this whole block to the request parser instead? 👍
README.md
Outdated
There was a problem hiding this comment.
AFAICT $_SERVER['https'] will be unset for plain HTTP, does it really make sense to assume a null value here?
examples/02-client-ip.php
Outdated
There was a problem hiding this comment.
?! Does not match example from the README.
There was a problem hiding this comment.
Oopsie. Wrong example.
|
Doesn't it make sense to make the keys match the keys from |
|
@jsor I have no preference here as the keys are rather arbitrary anyway, how do others handle this? |
|
Most PSR7 implementations pass https://github.com/zendframework/zend-diactoros/blob/master/src/ServerRequestFactory.php#L59 So, i think it makes sense to follow common behaviour. |
0cf4b27 to
dc008c0
Compare
src/Server.php
Outdated
There was a problem hiding this comment.
Nope you are right.
src/RequestHeaderParser.php
Outdated
There was a problem hiding this comment.
Not a big fan of empty() here ("0" could technically be a valid UDS address). Does it make sense to use a null check here and below?
There was a problem hiding this comment.
Replaced empty() in newest commit.
src/RequestHeaderParser.php
Outdated
There was a problem hiding this comment.
Naming convention is a bit unclear WRT local address / URI?
There was a problem hiding this comment.
Renamed vars in newest commit.
examples/02-client-ip.php
Outdated
3eab518 to
677076c
Compare
|
Ping @clue Added some tests to the |
This PR adds server-side parameters similar to parameters of the $_SERVER from PHP.
This should cover the most important parameters.